import {Injectable} from '@angular/core';

import {HttpClient, HttpParams} from '@angular/common/http';

import {Observer, Subject} from 'rxjs';

@Injectable({
  providedIn: 'root'
})

export class ListService {

  private url = 'https://www.izhiliao.com/esf/api/house/filter';

  constructor(private http: HttpClient) {
  }

  getList() {
    return this.http.post(this.url, {
      siteId: 1,
      type: 1
    });
  }

  // 在外部产生新事件。
  test1(): Observer<any> {
    const o = new Subject();
    o.subscribe(val => {
      console.log(val);
    });
    return o;
  }
}
